<!DOCTYPE html>
<html lang="en">

<head>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js" type="text/javascript"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js" integrity="sha384-alpBpkh1PFOepccYVYDB4do5UnbKysX5WZXm3XxPqe5iKTfUKjNkCk9SaVuEZflJ"
        crossorigin="anonymous"></script>
    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0q5P2rRUpPvrszuE4W1povHYgTpBfshb"
        crossorigin="anonymous">
    <script type="text/javascript">

        var getDate = function (y, m) {
            var s, e;
            if (m == "01") { s = y + "-01-01"; e = y + "-01-31" }
            if (m == "02") { s = y + "-02-01"; e = y + "-02-28" }
            if (m == "03") { s = y + "-03-01"; e = y + "-03-31" }
            if (m == "04") { s = y + "-04-01"; e = y + "-04-30" }
            if (m == "05") { s = y + "-05-01"; e = y + "-05-31" }
            if (m == "06") { s = y + "-06-01"; e = y + "-06-30" }
            if (m == "07") { s = y + "-07-01"; e = y + "-07-31" }
            if (m == "08") { s = y + "-08-01"; e = y + "-08-31" }
            if (m == "09") { s = y + "-09-01"; e = y + "-09-30" }
            if (m == "10") { s = y + "-10-01"; e = y + "-10-31" }
            if (m == "11") { s = y + "-11-01"; e = y + "-11-30" }
            if (m == "12") { s = y + "-12-01"; e = y + "-12-31" }
            return [s, e];
        };


        var url = window.location.href;
        var arrayUrl = url.split('=');
        var ou = arrayUrl[3];
        var arrayUrl1 = arrayUrl[2].split('&');
        var pe = arrayUrl1[0];
        var year = pe.substring(0, 4);
        var month = pe.substring(4, 6);
        var prog_id = "VCuHIFtJJSv";
        var dates = getDate(year, month);
        var startdate = dates[0];
        var enddate = dates[1];
        var predate = new Date(startdate);
        predate.setMonth(predate.getMonth() - 3);
        var d1 = "MIOqsaeW1s5";
        var d2 = "rLfKA2uDpI1";
        var d3 = "XBpPEm4twyG";
        var d4 = "lzBg6QalyhT";
        var d5 = "uoVoakOJULl";
        var d6 = "pHxWTwQMMmR";
        var d7 = "PoCEfKNlJJk";
        var d8 = "Ft37n3yO81y";
        var d9 = "JYrVSslAvWF";
        var d10 = "z7aLqkhkdIn";

        var dd1 = "iqnWbI6EFOb";
        var dd2 = "GSH68kIsvKX";
        var dd3 = "tLUOAB3NwP8";
        var dd4 = "GSH68kIsvKX";
        var dd5 = "nwFajZjl3Fa";
        var dd6 = "xwLbbjni5iY";
        var dd7 = "Qw7vZ5x7H0e";
        var dd8 = "D4Z6XYfNQR9";
        var dd9 = "CqOIRxdVmay";
        var dd10 = "es15Sv05Nmb";
        var totalevent, totalEndevent = 0, activeatendevent = 0,exitpatients = 0;
        var hasFollowup3mon = 0;
        var LTFU6mon = 0;
        var LTFU12mon = 0;
        var checkStatus = function (data) {
            data.enrollments.forEach(function (element, index) {
                var tei = element.trackedEntityInstance;

                $.when(
                    $.getJSON("../api/events.json?orgUnit=" + ou + "&program=" + prog_id + "&programStage=HvBZokNtaEZ&trackedEntityInstance=" + tei + "&order=eventDate:ASCskipPaging=true", {
                        format: "json"
                    }),
                    $.getJSON("../api/events.json?orgUnit=" + ou + "&program=" + prog_id + "&programStage=kwXu1zEDMEe&trackedEntityInstance=" + tei + "&skipPaging=true", {
                        format: "json"
                    })

                ).then(function (data11,data22) {
                  var data1 = data11[0];
                  var data2 = data22[0];
                  var fvflag1 = 0,fvflag2 = 0,fvflag3 = 0,fvflag4 = 0,fvflag5 = 0;
                  var fvflag6 = 0,fvflag7 = 0,fvflag8 = 0,fvflag9 = 0,fvflag10 = 0;
                  var eventss = data2.events[0];
                  //checking for values in first stage1

                  for (var j = 0; j < eventss.dataValues.length; j++) {
                    //  if (flag1 == 0) {
                          if (eventss.dataValues[j].dataElement == dd1 && (eventss.dataValues[j].value == "Newly_diagnosed" || eventss.dataValues[j].value == "Previously_diagnosed" )) {
                            //  totalEndevent++;
                              fvflag1 = 1;
                          }
                    //  }
                    //  if (flag2 == 0) {
                          if (eventss.dataValues[j].dataElement == dd2 && (eventss.dataValues[j].value == "Newly_diagnosed" || eventss.dataValues[j].value == "Previously_diagnosed" )) {
                            //  totalEndevent++;
                              fvflag2 = 1;
                          }
                    //  }
                    //  if (flag3 == 0) {
                          if (eventss.dataValues[j].dataElement == dd3 && (eventss.dataValues[j].value == "Newly_diagnosed" || eventss.dataValues[j].value == "Previously_diagnosed" )) {
                            //  totalEndevent++;
                              fvflag3 = 1;
                          }
                    //  }
                    //  if (flag4 == 0) {
                          if (eventss.dataValues[j].dataElement == dd4 && (eventss.dataValues[j].value == "Newly_diagnosed" || eventss.dataValues[j].value == "Previously_diagnosed" )) {
                            //  totalEndevent++;
                              fvflag4 = 1;
                          }
                    //  }
                    //  if (flag5 == 0) {
                          if (eventss.dataValues[j].dataElement == dd5 && (eventss.dataValues[j].value == "Newly_diagnosed" || eventss.dataValues[j].value == "Previously_diagnosed" )) {
                            //  totalEndevent++;
                              fvflag5 = 1;
                          }
                    //  }
                    //  if (flag6 == 0) {
                          if (eventss.dataValues[j].dataElement == dd6 && (eventss.dataValues[j].value == "Newly_diagnosed" || eventss.dataValues[j].value == "Previously_diagnosed" )) {
                              fvflag6 = 1;
                          }
                    //  }
                    //  if (flag7 == 0) {
                          if (eventss.dataValues[j].dataElement == dd7 && (eventss.dataValues[j].value == "Newly_diagnosed" || eventss.dataValues[j].value == "Previously_diagnosed" )) {
                            //  totalEndevent++;
                              fvflag7 = 1;
                          }
                    //  }
                    //  if (flag8 == 0) {
                          if (eventss.dataValues[j].dataElement == dd8 && (eventss.dataValues[j].value == "Newly_diagnosed" || eventss.dataValues[j].value == "Previously_diagnosed" )) {
                          //    totalEndevent++;
                              fvflag8 = 1;
                          }
                    //  }

                  // if (flag9 == 0) {
                      if (eventss.dataValues[j].dataElement == dd9 && (eventss.dataValues[j].value == "Newly_diagnosed" || eventss.dataValues[j].value == "Previously_diagnosed" )) {
                        //  totalEndevent++;
                          fvflag9 = 1;
                      }
                //  }
                //  if (flag10 == 0) {
                      if (eventss.dataValues[j].dataElement == dd10 && (eventss.dataValues[j].value == "Newly_diagnosed" || eventss.dataValues[j].value == "Previously_diagnosed" )) {
                        //  totalEndevent++;
                          fvflag10 = 1;
                      }
                //  }
                  }

                  //checking for values in follow-up visits



                    if (data1.events.length != 0) {
                        var events = data1.events;
                        var flag1 = 0, flag2 = 0, flag3 = 0, flag4 = 0, flag5 = 0, flag6 = 0, flag7 = 0, flag8 = 0, flag9 = 0, flag10 = 0, flag11 = 0;
                        for (var i = 0; i < events.length; i++) {
                            var date = events[i].eventDate;
                            var first = date.split('T')[0];
                            var expireDate = new Date(first);
                            if(expireDate <= new Date(enddate)){
                            if (new Date(startdate) <= expireDate) {
                                for (var jj = 0; jj < events[i].dataValues.length; jj++) {
                                    if (flag1 == 0 && fvflag1 == 0) {
                                        if (events[i].dataValues[jj].dataElement == d1 && events[i].dataValues[jj].value == "Newly_diagnosed") {
                                            totalEndevent++;
                                            console.log(events[i].trackedEntityInstance);
                                            flag1 = 1;
                                        }
                                    }
                                    if (flag2 == 0 && fvflag2 == 0) {
                                        if (events[i].dataValues[jj].dataElement == d2 && events[i].dataValues[jj].value == "Newly_diagnosed") {
                                            totalEndevent++;
                                            console.log(events[i].trackedEntityInstance);
                                            flag2 = 1;
                                        }
                                    }
                                    if (flag3 == 0 && fvflag3 == 0) {
                                        if (events[i].dataValues[jj].dataElement == d3 && events[i].dataValues[jj].value == "Newly_diagnosed") {
                                            totalEndevent++;
                                            console.log(events[i].trackedEntityInstance);
                                            flag3 = 1;
                                        }
                                    }
                                    if (flag4 == 0 && fvflag4 == 0) {
                                        if (events[i].dataValues[jj].dataElement == d4 && events[i].dataValues[jj].value == "Newly_diagnosed") {
                                            totalEndevent++;
                                            console.log(events[i].trackedEntityInstance);
                                            flag4 = 1;
                                        }
                                    }
                                    if (flag5 == 0 && fvflag5 == 0) {
                                        if (events[i].dataValues[jj].dataElement == d5 && events[i].dataValues[jj].value == "Newly_diagnosed") {
                                            totalEndevent++;
                                            console.log(events[i].trackedEntityInstance);
                                            flag5 = 1;
                                        }
                                    }
                                    if (flag6 == 0 && fvflag6 == 0) {
                                        if (events[i].dataValues[jj].dataElement == d6 && events[i].dataValues[jj].value == "Newly_diagnosed") {
                                            totalEndevent++;
                                            console.log(events[i].trackedEntityInstance);
                                            flag6 = 1;
                                        }
                                    }
                                    if (flag7 == 0  && fvflag7 == 0) {
                                        if (events[i].dataValues[jj].dataElement == d7 && events[i].dataValues[jj].value == "Newly_diagnosed") {
                                            totalEndevent++;
                                            console.log(events[i].trackedEntityInstance);
                                            flag7 = 1;
                                        }
                                    }
                                    if (flag8 == 0 && fvflag8 == 0) {
                                        if (events[i].dataValues[jj].dataElement == d8 && events[i].dataValues[jj].value == "Newly_diagnosed") {
                                            totalEndevent++;
                                            console.log(events[i].trackedEntityInstance);
                                            flag8 = 1;
                                        }
                                    }

                                if (flag9 == 0 && fvflag9 == 0) {
                                    if (events[i].dataValues[jj].dataElement == d9 && events[i].dataValues[jj].value == "Newly_diagnosed") {
                                        totalEndevent++;
                                        console.log(events[i].trackedEntityInstance);
                                        flag9 = 1;
                                    }
                                }
                                if (flag10 == 0 && fvflag10 == 0) {
                                    if (events[i].dataValues[jj].dataElement == d10 && events[i].dataValues[jj].value == "Newly_diagnosed") {
                                        totalEndevent++;
                                        console.log(events[i].trackedEntityInstance);
                                        flag10 = 1;
                                    }
                                }
                                }
                            }
                            else{

                              for (var p = 0; p < events[i].dataValues.length; p++) {
                                //  if (flag1 == 0) {
                                      if (events[i].dataValues[p].dataElement == d1 && events[i].dataValues[p].value == "Newly_diagnosed") {
                                        //  totalEndevent++;
                                          flag1 = 1;
                                      }
                                //  }
                              //    if (flag2 == 0) {
                                      if (events[i].dataValues[p].dataElement == d2 && events[i].dataValues[p].value == "Newly_diagnosed") {
                                        //  totalEndevent++;
                                          flag2 = 1;
                                      }
                              //    }
                                //  if (flag3 == 0) {
                                      if (events[i].dataValues[p].dataElement == d3 && events[i].dataValues[p].value == "Newly_diagnosed") {
                                        //  totalEndevent++;
                                          flag3 = 1;
                                      }
                              //    }
                              //    if (flag4 == 0) {
                                      if (events[i].dataValues[p].dataElement == d4 && events[i].dataValues[p].value == "Newly_diagnosed") {
                                        //  totalEndevent++;
                                          flag4 = 1;
                                      }
                              //    }
                              //    if (flag5 == 0) {
                                      if (events[i].dataValues[p].dataElement == d5 && events[i].dataValues[p].value == "Newly_diagnosed") {
                                        //  totalEndevent++;
                                          flag5 = 1;
                                      }
                              //    }
                              //    if (flag6 == 0) {
                                      if (events[i].dataValues[p].dataElement == d6 && events[i].dataValues[p].value == "Newly_diagnosed") {
                                        //  totalEndevent++;
                                          flag6 = 1;
                                      }
                              //    }
                              //    if (flag7 == 0) {
                                      if (events[i].dataValues[p].dataElement == d7 && events[i].dataValues[p].value == "Newly_diagnosed") {
                                        //  totalEndevent++;
                                          flag7 = 1;
                                      }
                              //    }
                              //    if (flag8 == 0) {
                                      if (events[i].dataValues[p].dataElement == d8 && events[i].dataValues[p].value == "Newly_diagnosed") {
                                      //    totalEndevent++;
                                          flag8 = 1;
                                      }
                            //      }

                          //    if (flag9 == 0) {
                                  if (events[i].dataValues[p].dataElement == d9 && events[i].dataValues[p].value == "Newly_diagnosed") {
                                    //  totalEndevent++;
                                      flag9 = 1;
                                  }
                            //  }
                            //  if (flag10 == 0) {
                                  if (events[i].dataValues[p].dataElement == d10 && events[i].dataValues[p].value == "Newly_diagnosed") {
                                    //  totalEndevent++;
                                      flag10 = 1;
                                  }
                            //  }
                              }

                            }
                          }
                        }

                    }
                    document.getElementById('totalNumber').innerHTML = totalEndevent;
                    if (data.enrollments.length - 1 == index) {
                      //  document.getElementById('loader').style.display = "none";
                    }
                });

            });

        };

        var checkStatus2 = function (data) {
            data.enrollments.forEach(function (element, index) {
                var tei = element.trackedEntityInstance;
                var count = 0, count2 = 0, count3 = 0, count4 = 0;
                var flag6mon = 0,countExit = 0;
                var flag12mon = 0;
                $.when(
                    $.getJSON("../api/events.json?orgUnit=" + ou + "&program=" + prog_id + "&programStage=HvBZokNtaEZ&trackedEntityInstance=" + tei + "&skipPaging=true&programEndDate=" + enddate, {
                        format: "json"
                    }),
                    $.getJSON("../api/events.json?orgUnit=" + ou + "&program=" + prog_id + "&programStage=Kr60c8j7vMe&trackedEntityInstance=" + tei + "&skipPaging=true", {
                        format: "json"
                    }),
                    $.getJSON("../api/events.json?orgUnit=" + ou + "&program=" + prog_id + "&programStage=Kr60c8j7vMe&trackedEntityInstance=" + tei + "&skipPaging=true&programStartDate="+ startdate +"&programEndDate=" + enddate, {
                        format: "json"
                    })
                ).then(function (data1, data2, data3) {

                    // data1 api call
                    if (data2[0].events.length == 0) {
                        count = 1;
                    }
                    else if (data2.httpStatusCode == 409 || data2.httpStatusCode == "409") { count = 2; }
                    else {
                        var date = data2[0].events[0].eventDate;
                        var first = date.split('T')[0];
                        var expireDate = new Date(first);
                        if (new Date(enddate) < expireDate) {
                            count = 1;
                        }
                    }

                    //data3 api call
                    if (data2[0].events.length == 0) {
                        countExit = 0;
                    }
                    else{
                        countExit = 1;
                    }


                    //data2 api call
                    if (data1[0].events.length == 0) {
                        count2 = 0;
                    }
                    else if (data1.httpStatusCode == 409 || data1.httpStatusCode == "409") { count2 = 0; }
                    else {
                        for (var b = 0; b < data1[0].events.length; b++) {
                            var date = data1[0].events[b].eventDate;
                            var first = date.split('T')[0];
                            var expireDate = new Date(first);
                            if (b == data1[0].events.length - 1 && b != 0) {
                                expireDate2 = expireDate;
                            }
                            else if (b == data1[0].events.length - 1 && b == 0) {
                                var date = data1[0].events[b].eventDate;
                                var first = date.split('T')[0];
                                var expireDate = new Date(first);
                                expireDate2 = expireDate;
                                latestEventDate = first;
                            }
                            else {
                                var date = data1[0].events[b].eventDate;
                                var first = date.split('T')[0];
                                var expireDate = new Date(first);
                                var date2 = data1[0].events[b + 1].eventDate;
                                var second = date2.split('T')[0];
                                var expireDate2 = new Date(second);
                            }
                            if (expireDate > expireDate2) {
                                latestEventDate = first;
                            }
                            else if (expireDate2 > expireDate) {
                                latestEventDate = second;
                            }
                            else {
                                latestEventDate = latestEventDate;
                            }
                            var dateSixMonthsAgo = new Date(startdate);
                            var dateTwelveMonthsAgo = new Date(startdate);
                            dateSixMonthsAgo.setMonth(dateSixMonthsAgo.getMonth() - 6);
                            dateTwelveMonthsAgo.setFullYear(dateTwelveMonthsAgo.getFullYear() - 1);
                            dateTwelveMonthsAgo.setDate(dateTwelveMonthsAgo.getDate() - 1);
                            if (new Date(startdate) > expireDate && expireDate >= predate) {
                                count2 = 1;
                            }
                          //  if (flag6mon != 1) {
                                if (new Date(enddate) >= new Date(latestEventDate) && new Date(latestEventDate) <= dateSixMonthsAgo) {
                                    count3 = 1;
                                }
                                else {
                                    count3 = 0;
                                }
                                if (new Date(enddate) >= new Date(latestEventDate) && new Date(latestEventDate) <= dateTwelveMonthsAgo) {
                                    count4 = 1;
                                }
                                else {
                                    count4 = 0;
                                }

                          //  }
                        }
                    }

                        if (count == 1) {
                            activeatendevent++;
                        }
                        if (count2 == 1 && count == 1) {
                            hasFollowup3mon++;
                        }
                        if (count3 == 1 && count == 0) {
                            LTFU6mon++;
                        }
                        if (count4 == 1 && count == 0) {
                            LTFU12mon++;
                        }
                        if(countExit == 1){
                            exitpatients++;
                        }
                        document.getElementById('totalNumber2').innerHTML = hasFollowup3mon;
                        document.getElementById('totalNumber3').innerHTML = activeatendevent;
                        document.getElementById('totalNumber4').innerHTML = LTFU6mon;
                        document.getElementById('totalNumber5').innerHTML = LTFU12mon;
                        document.getElementById('totalNumber6').innerHTML = activeatendevent + exitpatients;
                        if (data.enrollments.length - 1 == index) {
                            document.getElementById('loader').style.display = "none";
                        }
                    });

            });

        };
var totalEvents =0;
        $(document).ready(function () {

            $.when(
                $.getJSON("../api/enrollments.json?ou=" + ou + "&ouMode=DESCENDANTS&program=" + prog_id + "&fields=trackedEntityInstance&skipPaging=true&programEndDate=" + enddate, {
                    format: "json"
                })
            ).then(function (dataa) {
                if (dataa.enrollments.length == 0) {
                    alert('No enrollments found!');
                }
                else {
                totalEvents =   dataa.enrollments.length;
                document.getElementById('totalE').innerHTML = totalEvents;
                  checkStatus(dataa);
                    checkStatus2(dataa);

                }
            });
        });
    </script>
    <style>
        table {
            table-layout: fixed;
            word-wrap: break-word;
            text-align: center;
        }

        /* Absolute Center Spinner */

        .loading {
            position: fixed;
            z-index: 999;
            height: 2em;
            width: 2em;
            overflow: show;
            margin: auto;
            top: 0;
            left: 0;
            bottom: 0;
            right: 0;
        }

        /* Transparent Overlay */

        .loading:before {
            content: '';
            display: block;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.3);
        }

        /* :not(:required) hides these rules from IE9 and below */

        .loading:not(:required) {
            /* hide "loading..." text */
            font: 0/0 a;
            color: transparent;
            text-shadow: none;
            background-color: transparent;
            border: 0;
        }

        .loading:not(:required):after {
            content: '';
            display: block;
            font-size: 10px;
            width: 1em;
            height: 1em;
            margin-top: -0.5em;
            -webkit-animation: spinner 1500ms infinite linear;
            -moz-animation: spinner 1500ms infinite linear;
            -ms-animation: spinner 1500ms infinite linear;
            -o-animation: spinner 1500ms infinite linear;
            animation: spinner 1500ms infinite linear;
            border-radius: 0.5em;
            -webkit-box-shadow: rgba(0, 0, 0, 0.75) 1.5em 0 0 0, rgba(0, 0, 0, 0.75) 1.1em 1.1em 0 0, rgba(0, 0, 0, 0.75) 0 1.5em 0 0, rgba(0, 0, 0, 0.75) -1.1em 1.1em 0 0, rgba(0, 0, 0, 0.5) -1.5em 0 0 0, rgba(0, 0, 0, 0.5) -1.1em -1.1em 0 0, rgba(0, 0, 0, 0.75) 0 -1.5em 0 0, rgba(0, 0, 0, 0.75) 1.1em -1.1em 0 0;
            box-shadow: rgba(0, 0, 0, 0.75) 1.5em 0 0 0, rgba(0, 0, 0, 0.75) 1.1em 1.1em 0 0, rgba(0, 0, 0, 0.75) 0 1.5em 0 0, rgba(0, 0, 0, 0.75) -1.1em 1.1em 0 0, rgba(0, 0, 0, 0.75) -1.5em 0 0 0, rgba(0, 0, 0, 0.75) -1.1em -1.1em 0 0, rgba(0, 0, 0, 0.75) 0 -1.5em 0 0, rgba(0, 0, 0, 0.75) 1.1em -1.1em 0 0;
        }

        /* Animation */

        @-webkit-keyframes spinner {
            0% {
                -webkit-transform: rotate(0deg);
                -moz-transform: rotate(0deg);
                -ms-transform: rotate(0deg);
                -o-transform: rotate(0deg);
                transform: rotate(0deg);
            }
            100% {
                -webkit-transform: rotate(360deg);
                -moz-transform: rotate(360deg);
                -ms-transform: rotate(360deg);
                -o-transform: rotate(360deg);
                transform: rotate(360deg);
            }
        }

        @-moz-keyframes spinner {
            0% {
                -webkit-transform: rotate(0deg);
                -moz-transform: rotate(0deg);
                -ms-transform: rotate(0deg);
                -o-transform: rotate(0deg);
                transform: rotate(0deg);
            }
            100% {
                -webkit-transform: rotate(360deg);
                -moz-transform: rotate(360deg);
                -ms-transform: rotate(360deg);
                -o-transform: rotate(360deg);
                transform: rotate(360deg);
            }
        }

        @-o-keyframes spinner {
            0% {
                -webkit-transform: rotate(0deg);
                -moz-transform: rotate(0deg);
                -ms-transform: rotate(0deg);
                -o-transform: rotate(0deg);
                transform: rotate(0deg);
            }
            100% {
                -webkit-transform: rotate(360deg);
                -moz-transform: rotate(360deg);
                -ms-transform: rotate(360deg);
                -o-transform: rotate(360deg);
                transform: rotate(360deg);
            }
        }

        @keyframes spinner {
            0% {
                -webkit-transform: rotate(0deg);
                -moz-transform: rotate(0deg);
                -ms-transform: rotate(0deg);
                -o-transform: rotate(0deg);
                transform: rotate(0deg);
            }
            100% {
                -webkit-transform: rotate(360deg);
                -moz-transform: rotate(360deg);
                -ms-transform: rotate(360deg);
                -o-transform: rotate(360deg);
                transform: rotate(360deg);
            }
        }

        button {
            cursor: pointer;
        }
    </style>

    <body>
        <div class="loading" id="loader">Loading&#8230;</div>

        <br>
        <table class="table table-bordered table-hover reporttable">
            <thead>
                <tr>
                    <td style="width:50%">Number of new diagnoses identified in follow-up visits</td>
                    <td style="width:50%" id="totalNumber"></td>
                </tr>
                <tr>
                    <td style="width:50%">Number of patients with at least 1 follow up consultation in the previous 3 months</td>
                    <td style="width:50%" id="totalNumber2"></td>
                </tr>
                <tr>
                    <td style="width:50%">Total number of active patients at end of reporting period </td>
                    <td style="width:50%" id="totalNumber3"></td>
                </tr>
                <tr>
                    <td style="width:50%">Lost to follow up 6 months</td>
                    <td style="width:50%" id="totalNumber4"></td>
                </tr>
                <tr>
                    <td style="width:50%">Lost to follow up 12 months</td>
                    <td style="width:50%" id="totalNumber5"></td>
                </tr>
                <tr>
                    <td style="width:50%">Total Patients</td>
                    <td style="width:50%" id="totalE"></td>
                </tr>
                <tr>
                    <td style="width:50%">Total Active Patients + Exit patients during reporting period</td>
                    <td style="width:50%" id="totalNumber6"></td>
                </tr>
            </thead>
        </table>
    </body>

</html>
